package justtry;

/**
 * 将目标数据与1进行与操作若结果为1 则最低位为1  然后将输入数据右移一位
 *
 * Created by weishaofei on 2017/12/12.
 */
public class NumberOf1 {

    public static void main(String[] args) {
        int n = 63;
        int count = 0;
        while (n > 0) {
            if ((n & 1) == 1) {
                count++;
            }
            n = n >>1;
        }
        System.out.println(count);
    }
}
